<?php include_once($_SERVER['DOCUMENT_ROOT'].'/home/public/header.php'); 
$sum=3;
$p=isset($_GET['p'])&&!empty($_GET['p'])?$_GET['p']:1;
// var_dump($p);die;
$off=($p-1)*3; 
$res=sel($config,'article',"limit {$off},{$sum}")

?>

<div class="banner">
  <section class="box">
  
    <div class="avatar"><a href="#"><span>杨青</span></a> </div>
  </section>
</div>
<div class="template">
 
</div>
<article>
  
  <div class="bloglist left">

<?php 
foreach ($res as $v) {
echo '<h3>'.$v['title'].'</h3>
<figure><img src="'.$v['pic'].'"></figure>
<ul>
      <p>'.mb_substr(strip_tags($v['content']),0,21).'</p>
      <a href="/home/articlede.php?id='.$v['id'].'" target="_blank" class="readmore">阅读全文>></a>
    </ul>
 <p class="dateview"><span>发布时间:'.date('Y-m-d H:i:s',$v['time']).'</span><span>作者：'.$v['uid'].'</span><span></p>
';
}
 ?>   
<?php 
echo '<center>';
echo page($config,'article');
echo '</center>';
 ?> 
    <div class="page"><a title="Total record"><b>41</b></a><b>1</b><a href="/news/s/index_2.html">2</a><a href="/news/s/index_2.html">&gt;</a><a href="/news/s/index_2.html">&gt;&gt;</a></div>
</div>

<aside class="right">
 

    <div class="visitors">
      <h3><p>最近访客</p></h3>
      <ul>

      </ul>
    </div>
     <!-- Baidu Button BEGIN -->
    <div id="bdshare" class="bdshare_t bds_tools_32 get-codes-bdshare"><a class="bds_tsina"></a><a class="bds_qzone"></a><a class="bds_tqq"></a><a class="bds_renren"></a><span class="bds_more"></span><a class="shareCount"></a></div>
    <script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=6574585" ></script> 
    <script type="text/javascript" id="bdshell_js"></script> 
    <script type="text/javascript">
document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
</script> 
    <!-- Baidu Button END -->   
</aside>
</article>

<?php include_once($_SERVER['DOCUMENT_ROOT'].'/home/public/footer.php'); ?>